package test.rftennis.dao;



import java.util.HashMap;
import java.util.List;
import java.util.Map;


import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;

import com.rftennis.dao.CustomerDao;
import com.rftennis.dao.OrderDao;
import com.rftennis.dao.OrderItemDao;
import com.rftennis.dao.SqlSessionUtil;
import com.rftennis.entity.CustomerEntity;
import com.rftennis.entity.OrderEntity;
import com.rftennis.entity.OrderItemEntity;
@SpringJUnitConfig(locations ="classpath:/spring.xml")
public class testOrderItemDao {
	@Autowired
	OrderItemDao dao;
	

	
	@Test
	public void testselect() throws Exception {
		List<OrderItemEntity>ru=dao.selectOrderId("order_id", "2");
		for(int i = 0 ; i < ru.size() ; i++) {
			  System.out.println(ru.get(i));
			}
	}
	@Test
	public void testupdate() throws Exception{
		Map<String, Object> map=new HashMap<String, Object>();
        map.put("productPropertys", "黄中码");
	    dao.update("2", map);
	}
	@Test
	public void testdelete() throws Exception{
		dao.delete("8ad207b3eb5ad0da52648e9c45515d60");
	}
	@Test
	public void testselectid() throws Exception {
		OrderItemEntity o=dao.select("id", "1");
		System.out.println(o.toString());
	}
}	
